<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <th:block th:include="include :: header('企业良好行为审批')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <link href="../static/css/workboard.css" th:href="@{/css/workboard.css}" rel="stylesheet"/>
</head>
<style>
.tdContent{
	position:relative
}
input.error, select.error {
    background-color: #fbe2e2;
    border-color: #c66161;
    color: #c00;
}
label.error {
    position: absolute;
    right: 48px;
    top: 8px;
    color: #ef392b;
    font-size: 12px;
}
</style>
<body>
    <div class="container-div">
        <div class="tabsbody ">
            <div class="tabsbody-item active">
                <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
                    <tbody>
                        <tr>
                            <td>
                                <div class="page-title">
                                    <span>企业良好行为记录</span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <form id="formsubmit">
                                    <table cellpadding="0" cellspacing="0" class="tbEidt"
                                        style="width: 100%;word-break:break-all;background-color: #ffffff;">
                                        <tbody>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px">良好行为代码<font color="red">*
                                                    </font>
                                                </td>
                                                <td class="tdContent" style="text-align: left;">
                                                	<input type="hidden" name="IGMIntegrityApplyInfoGuid" style="width:90%;" readonly="readonly"  th:value="${applyInfo}==null or ${applyInfo.Guid}==null ? ' ':${applyInfo.Guid}">
                                                	<input type="hidden" name="Guid" style="width:90%;" readonly="readonly"  th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.Guid}==null ? ' ':${companyWellInfoEntity.Guid}">
                                                    <input type="text" id="BehaviorCode" name="BehaviorCode" style="width:90%;" readonly="readonly"  th:value="${StandardEntity}==null or ${StandardEntity.BehaviorCode}==null ? ' ':${StandardEntity.BehaviorCode}">
                                                </td>
                                                <td class="tdTitle">良好行为类别</td>
                                                <td class="tdContent">
                                                	<input type="text" readonly="readonly" name="BehaviorCategory" style="width:100%;border:0;outline:none;" th:value="${StandardEntity}==null or ${StandardEntity.BehaviorCategory}==null ? ' ':${StandardEntity.BehaviorCategory}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="width: 18%;">良好行为描述</td>
                                                <td class="tdContent" colspan="3">
                                                	<textarea name="BehaviorDescription" readonly="readonly" rows="3" cols="20"
                                                        style="width:100%;border:0;outline:none;" th:text="${StandardEntity}==null or ${StandardEntity.BehavioDescription}==null ? ' ':${StandardEntity.BehavioDescription}"></textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle">加分分值<font color="red">*</font>
                                                </td>
                                                <td class="tdContent" id="Score">
                                                	<input type="text" readonly="readonly" name="Score" style="width:100%;border:0;outline:none;color:red">
                                                </td>
                                                <td class="tdContent" colspan="2">有效期内累加上限分数：
                                                	<input type="text" readonly="readonly" name="MaxScores" style="width:20%;border:0;outline:none;color:red" th:value="${StandardEntity}==null or ${StandardEntity.MaxScores}==null ? ' ':${StandardEntity.MaxScores}">
                                                    	已加分数：
                                                    <input type="text" readonly="readonly" name="PointsAdded" style="width:20%;border:0;outline:none;color:red" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.PointsAdded}==null ? ' ':${companyWellInfoEntity.PointsAdded}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 50px;">获奖内容
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent" colspan="3">
                                                    <textarea name="AwardContent" rows="3" cols="20" readonly="readonly"
                                                        style="width:100%;"  th:text="${companyWellInfoEntity}==null or ${companyWellInfoEntity.AwardContent}==null ? ' ':${companyWellInfoEntity.AwardContent}"></textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px; width: 18%;">企业名称
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent" style="width: 32%; text-align: left;">
                                                    <input name="CompanyName" id="CompanyName" readonly="readonly" type="text" maxlength="100" style="width:90%;"  th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.CompanyName}==null ? ' ':${companyWellInfoEntity.CompanyName}">
                                                    <input name="CompanyGuid" type="hidden" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.CompanyGuid}==null ? ' ':${companyWellInfoEntity.CompanyGuid}">
                                                </td>
                                                <td class="tdTitle" style="width: 18%;">
									                                                    组织机构代码/&nbsp;<br>
									                                                    统一社会信用代码<font color="red">*</font>
                                                </td>
                                                <td class="tdContent" style="width: 32%">
                                                    <input name="OrganCode" id="OrganCode" type="text" readonly="readonly" class="txtSingleBox"
                                                        style="width:100%;" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.OrganCode}==null ? ' ':${companyWellInfoEntity.OrganCode}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px;">工程名称</td>
                                                <td class="tdContent" style="text-align: left;" colspan="3">
                                                    <input name="EngineeringName" type="text" class="txtSingleBox" readonly="readonly" style="width:40%;" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.EngineeringName}==null ? ' ':${companyWellInfoEntity.EngineeringName}">
                                                    <input name="EngineeringGuid" type="hidden" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.EngineeringGuid}==null ? ' ':${companyWellInfoEntity.EngineeringGuid}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px;">发生地所在市县
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                    <input name="City" type="text" readonly="readonly" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.City}==null ? ' ':${companyWellInfoEntity.City}" maxlength="100"
                                                        class="txtSingleBox" style="width:100%;">
                                                </td>
                                                <td class="tdTitle">所属区</td>
                                                <td class="tdContent" name="Area" readonly="readonly" style="width: 32%" th:text="${companyWellInfoEntity}==null or ${companyWellInfoEntity.Area}==null ? ' ':${companyWellInfoEntity.Area}"></td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px">奖励机构级别
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                	<input type="text" readonly="readonly" name="InLevel" th:value="${companyWellInfoEntity.InLevel}" style="width:100%;border:0;outline:none;">
                                                </td>
                                                <td class="tdTitle">奖励机构<font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                    <input name="AgencyName" readonly="readonly" type="text" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.AgencyName}==null ? ' ':${companyWellInfoEntity.AgencyName}" style="width:100%;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px;">奖励决定文号
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                    <input name="DocNumber" type="text" style="width:100%;" readonly="readonly" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.DocNumber}==null ? ' ':${companyWellInfoEntity.DocNumber}">
                                                </td>
                                                <td class="tdTitle">奖励决定日期<font color="red">*</font>
                                                </td>
                                                <td class="tdContent">
                                                    <div class="input-group date">
                                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                                        	<input type="text" name="AwardDate" readonly="readonly" placeholder="开始时间"/ autocomplete="off" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.AwardDate}==null ? ' ':${companyWellInfoEntity.AwardDate}">
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 32px;">登记人</td>
                                                <td class="tdContent">
                                                    <input id="txtRegPerson" name="RegPerson" readonly="readonly" style="width:80%;border:0;outline:none;" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.RegPerson}==null ? ' ':${companyWellInfoEntity.RegPerson}">
                                                    <input type="hidden" name="OwnerGuid" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.OwnerGuid}==null ? ' ':${companyWellInfoEntity.OwnerGuid}">
                                                </td>
                                                <td class="tdTitle">登记部门</td>
                                                <td class="tdContent">
                                                    <input id="txtRegDepartment" name="RegDepartment" readonly="readonly" style="width:80%;border:0;outline:none;" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.RegDepartment}==null ? ' ':${companyWellInfoEntity.RegDepartment}">
                                                    <input type="hidden" name="RegDepartmentGuid" th:value="${companyWellInfoEntity}==null or ${companyWellInfoEntity.RegDepartmentGuid}==null ? ' ':${companyWellInfoEntity.RegDepartmentGuid}">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" align="center" style="width: 18%; height: 32px">
                                                    <span id="labMaterials">相关材料</span>
                                                    <font color="red">*</font>
                                                </td>
                                                <td class="tdContent" colspan="3" align="left">
                                                    <div class="form-group" style="margin-bottom: 6px;margin-top: 6px;">
                                                    	<input type="hidden" name="Materials">
                                                    	<p class="iconfile" style="padding:4px;display:none">
                                                    		<span>
                                                    		  <i class="glyphicon glyphicon-file"></i>
                                                    		</span>
                                                    		<input name="FileNameOld" readonly="readonly" style="width:60%;border:0;outline:none;" class="hasPath" th:value="${FileNameOld}">
                                                    		<a th:if="${fileState == '1'}" class="btn btn-success btn-xs" th:onclick="openUrl([[${filePath}]],[[${companyWellInfoEntity.FileNameOld}]])"><i class="fa fa-edit"></i>下载</a>
                                                    		<a th:if="${fileState == '0'}" class="btn btn-success btn-xs" rel="noopener noreferrer" th:href="${filePath}" target="_blank"><i class="fa fa-edit"></i>下载</a>
                                                    	</p>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdTitle" style="height: 50px;">理由</td>
                                                <td class="tdContent" colspan="3">
                                                    <textarea name="reasonContent" rows="3" cols="20"
                                                        style="width:100%;" th:text="${igmar}==null or ${igmar.opinion}==null ? ' ':${igmar.opinion}"></textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdContent" colspan="4"
                                                    style="text-align: left; padding: 5px; line-height: 1.5;">&nbsp;[注1]
                                                   		 表格项目中带<font color="red">*</font>的必须填。
                                                    <br>
                                                    &nbsp;[注2]
                                                    	相关材料为奖励决定文书、通报、通知等扫描件，必须是格式(*.jpg;*.jpeg;*.png;*.rar;*.zip;*.pdf)，文件大小不超过10M，文件名最大长度为50个字。
                                                    <br>
                                                    &nbsp;[注3] “保存”按钮可以将当前已填写的内容保存下来以便下次修改，“保存并上报”按钮将填写的内容直接提交至系统处理。
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="row">
		        <div class="col-sm-offset-5 col-sm-10" style="margin-top:10px">
		            <button type="button" class="btn btn-sm btn-primary" onclick="approveReport(this)"><i class="fa fa-check"></i>通过</button>&nbsp;
		            <button type="button" class="btn btn-sm btn-primary" onclick="approveReport(this)"><i class="fa fa-remove"></i>不通过</button>&nbsp;
		            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
		        </div>
		    </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
    	var prefix = ctx+"integrityInformationAdd/enterprisesBehavior";
    	/* 隐藏域  */
    	var behaviorCode = $('input[name="BehaviorCode"]').val();
    	var companyGuid = $('input[name ="CompanyGuid"]').val();
    	var organCode = $('input[name ="OrganCode"]').val();
    	/* 下载  */
    	function openUrl(filePath, FileNameOld){
    		window.location.href = ctx + 'integrityInformationAdd/enterprisesBehavior/download?resource='+filePath+'&fileName='+ encodeURI(FileNameOld);
    	}
	    /*编辑加分   */
	    if($.isArray([[${subStr}]])){
 				for(var i = 0; i < [[${subStr}]].length; i++){
 					if([[${subStr}]][i] == [[${companyWellInfoEntity.Score}]]){
 						$('input[name="Score"]').val([[${companyWellInfoEntity.Score}]]);
 						break;
 					}
 				}
 			}else{
 				$('input[name="Score"]').val([[${companyWellInfoEntity.Score}]]);
 		};
    	/* 文件路径回显删除事件  */
    	/* function delPath(){
    		$('.iconfile').remove();
    		$('input[name="Materials"]').remove();
    	} */
    	/*判断是否有文件路径 && 文件路径 赋值隐藏域   */
    	if($.common.isNotEmpty([[${companyWellInfoEntity.Materials}]])){
    		$('input[name="Materials"]').val([[${companyWellInfoEntity.Materials}]]);
    		//$('input[name="FileNameOld"]')
    		$('.iconfile').show();
    	}else{
    		$('.iconfile').remove();
    	}
        /*审批*/
	    function approveReport(dom) {
	        if ($.validate.form()) {
	        	var contend = $(dom).text();
	        	var formData = $("#formsubmit").serializeArray();
	       		if(contend == "通过"){
	        		formData.push({"name": "SaveOrReport", "value": "通过"});
	        	}else if(contend == "不通过"){
	        		formData.push({"name": "SaveOrReport", "value": "不通过"});
	        	}
	       		$.operate.saveTab(prefix + "/enterprisesGoodBehaviorApprove", formData);
	        }
	    }
    </script>
</body>

</html>